home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2007 January, February, March & April
/
Chip-Cover-CD-2007-02.iso
/
Pakiet bezpieczenstwa
/
mini Pentoo LiveCD 2006.1
/
mpentoo-2006.1.iso
/
livecd.squashfs
/
usr
/
sbin
/
ipg
< prev
next >
Wrap
Text File
|
2005-10-13
|
533b
|
34 lines
#!/bin/bash
modprobe pg3 >& /dev/null
modprobe pktgen >& /dev/null
PGDEV=/proc/net/pg
if [[ ! -e ${PGDEV} ]] ; then
PGDEV=/proc/net/pktgen/pg0
if [[ ! -e ${PGDEV} ]] ; then
echo "Couldn't not locate pg in /proc/net :("
exit 1
fi
fi
function pgset() {
local result
echo $1 > ${PGDEV}
result=`cat ${PGDEV} | fgrep "Result: OK:"`
if [ "$result" = "" ]; then
cat ${PGDEV} | fgrep Result:
fi
}
function pg() {
echo inject > ${PGDEV}
cat ${PGDEV}
}
pgset "odev eth0"
pgset "dst 0.0.0.0"